<?php
namespace app\admin\controller;

use think\Controller;
use think\Session;

class Index extends Controller
{
    public function index()
    {
        $session=Session::get('admin');
        if (!empty($session)){
            return $this->fetch();
        }
        else{
            $this->error('您没有权限!','admin/login/index');
        }
    }

    public function destory () {
        Session::clear('think');
        return $this->redirect('login/index');
    }
}

